package com.yitao.cms.service.shopInfo;

import com.skipper.base.bean.PagedOutput;
import com.yitao.client.model.shopInfo.ShopUserGradeInfoModel;
import com.yitao.client.model.shopInfo.ShopUserGradeModel;
import com.yitao.client.model.shopInfo.ShopUserGradeWealModel;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;

@FeignClient(name = "userLevel-svc", path = "/userLevel-svc/app/shopGrade")
public interface ShopUserGradeService {

    @RequestMapping(method = RequestMethod.POST, path = "/getShopUserGradeModelByShopIdAndUserId", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    ShopUserGradeModel getShopUserGradeModelByShopIdAndUserId(@ApiParam(value = "门店ID", required = true) @RequestParam(value = "shopId") Long shopId,
                                                              @ApiParam(value = "用户ID", required = true) @RequestParam(value = "userId") Long userId);

    @RequestMapping(method = RequestMethod.POST, path = "/saveShopUserGradeModelList", consumes = MediaType.APPLICATION_JSON_VALUE)
    void saveShopUserGradeModelList(@RequestBody List<ShopUserGradeModel> shopUserGradeModels);

    @RequestMapping(method = RequestMethod.POST, path = "/updateUserGradeByBean", consumes = MediaType.APPLICATION_JSON_VALUE)
    ShopUserGradeModel updateUserGradeByBean(@RequestBody ShopUserGradeModel shopUserGradeModel);

    @RequestMapping(method = RequestMethod.POST, path = "/getShopUserGradeModelById", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    ShopUserGradeModel getShopUserGradeModelById(@ApiParam(value = "id", required = true) @RequestParam(value = "id") Long id);

    @RequestMapping(method = RequestMethod.POST, path = "/getShopUserGradeInfoByShopId", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    List<ShopUserGradeInfoModel> getShopUserGradeInfoByShopId(@ApiParam(value = "门店ID", required = true) @RequestParam(value = "shopId") Long shopId);

    @RequestMapping(method = RequestMethod.POST, path = "/getShopUserGradeInfoById", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    ShopUserGradeInfoModel getShopUserGradeInfoById(@ApiParam(value = "id", required = true) @RequestParam(value = "id") Long id);

    @RequestMapping(method = RequestMethod.POST, path = "/updateUserGradeInfoByBean", consumes = MediaType.APPLICATION_JSON_VALUE)
    ShopUserGradeInfoModel updateUserGradeInfoByBean(@RequestBody ShopUserGradeInfoModel shopUserGradeInfoModel);

    @RequestMapping(method = RequestMethod.POST, path = "/getShopUserGradeInfoByIdxAndShopId", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    ShopUserGradeInfoModel getShopUserGradeInfoByIdxAndShopId(@ApiParam(value = "门店ID", required = true) @RequestParam(value = "shopId") Long shopId,
                                                              @ApiParam(value = "等级", required = true) @RequestParam(value = "idx") Integer idx);

    @RequestMapping(method = RequestMethod.POST, path = "/saveShopUserGradeWealList", consumes = MediaType.APPLICATION_JSON_VALUE)
    void saveShopUserGradeWealList(@RequestBody List<ShopUserGradeWealModel> shopUserGradeWealModelList);

    @RequestMapping(method = RequestMethod.POST, path = "/getShopUserGradeWealByGradeInfoId", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    List<ShopUserGradeWealModel> getShopUserGradeWealByGradeInfoId(@ApiParam(value = "gradeInfoId", required = true) @RequestParam(value = "gradeInfoId") Long gradeInfoId,
                                                                   @ApiParam(value = "shopId", required = true) @RequestParam(value = "shopId") Long shopId);

    @RequestMapping(method = RequestMethod.POST, path = "/getShopUserList", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    PagedOutput<ShopUserGradeModel> getShopUserList(@ApiParam(value = "用户ID", required = false) @RequestParam(value = "userId", required = false) Long userId,
                                                    @ApiParam(value = "门店ID", required = false) @RequestParam(value = "shopId", required = false) Long shopId,
                                                    @ApiParam(value = "昵称", required = false) @RequestParam(value = "userName", required = false) String userName,
                                                    @ApiParam(value = "手机号", required = false) @RequestParam(value = "phone", required = false) String phone,
                                                    @ApiParam(value = "升级时间开始时间", required = false) @RequestParam(value = "updateStaDate", required = false) String updateStaDate,
                                                    @ApiParam(value = "升级时间结束时间", required = false) @RequestParam(value = "updateEndDate", required = false) String updateEndDate,
                                                    @ApiParam(value = "身份等级", required = false) @RequestParam(value = "idx", required = false) Integer idx,
                                                    @ApiParam(value = "注册时间开始时间", required = false) @RequestParam(value = "loginStaDate", required = false) String loginStaDate,
                                                    @ApiParam(value = "注册时间结束时间", required = false) @RequestParam(value = "loginEndDate", required = false) String loginEndDate,
                                                    @ApiParam(value = "分页参数，表示当前页", required = true, defaultValue = "1") @RequestParam(value = "pageNo", required = true) Integer pageNo,
                                                    @ApiParam(value = "分页参数，表示每页显示多少条记录", required = true, defaultValue = "10") @RequestParam(value = "pageSize", required = true) Integer pageSize);
}
